package com.dabai.addtofavorites.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.dabai.addtofavorites.R;
import com.dabai.addtofavorites.bean.FavData;
import com.dabai.dbutils.utils.DateUtils;

import java.io.File;
import java.util.Date;
import java.util.List;

public class FavAdapter extends BaseQuickAdapter<FavData,BaseViewHolder> {

    public FavAdapter(List<FavData> data) {
        super(R.layout.item_fav, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, FavData favData) {
        baseViewHolder.setText(R.id.textView1, favData.getContent());
        baseViewHolder.setText(R.id.textView2, DateUtils.humanInterval(new Date(favData.getFile().lastModified())));

    }



}
